R Markdown and Leaflet

Overview

Create a web page presentation using R Markdown that features a plot created with Plotly.

Host your webpage on either GitHub Pages, RPubs, or NeoCities.

Your webpage must contain the date that you created the document, and it must contain a plot created with Plotly.

A plot example

library(plotly)
data <- diamonds[sample(nrow(diamonds), 2500),
                 c("carat", "price", "clarity", "depth")]
summary(data)
##      carat            price            clarity        depth     
##  Min.   :0.2000   Min.   :  327.0   SI1    :615   Min.   :52.2  
##  1st Qu.:0.4000   1st Qu.:  935.8   VS2    :544   1st Qu.:61.0  
##  Median :0.7000   Median : 2364.5   SI2    :426   Median :61.8  
##  Mean   :0.7941   Mean   : 3837.9   VS1    :355   Mean   :61.7  
##  3rd Qu.:1.0400   3rd Qu.: 5085.5   VVS2   :236   3rd Qu.:62.5  
##  Max.   :4.0100   Max.   :18656.0   VVS1   :184   Max.   :69.3  
##                                     (Other):140
plot_ly(data, x = ~carat, y = ~price, color = ~carat, size = ~carat, text = ~paste("Clarity: ", clarity))  %>%
  layout(title = "Dimond price/carat dependency, May 30th, 2025",
         xaxis = list(title = "Dimonds Carat"),
         yaxis = list(title = "Price"))